using System;
using System.Collections.Generic;
using PPIDesktopClient.General;
using System.Text;

namespace PPIDesktopClient.Entities
{
    [Serializable]
    public class EVendor_Visit_XMissionStructures_Pole : EBasePole
    {
        #region Miembros Privados
        Int32 m_PoleServerID;
        Int32 m_StructureServerID;
        DateTime m_UploadedDate;
        Int32 m_HaveImages;
        private List<Int32> m_DesasocciateImages;
        #endregion Miembros Privados

        #region Propiedades
        public Int32 PoleServerID
        {
            get { return m_PoleServerID; }
            set { m_PoleServerID = value; }
        }
        public Int32 StuctureServerID
        {
            get { return m_StructureServerID; }
            set { m_StructureServerID = value; }
        }
        public DateTime UploadedDate
        {
            get { return m_UploadedDate; }
            set { m_UploadedDate = value; }
        }
        public Int32 HaveImages
        {
            get { return m_HaveImages; }
            set { m_HaveImages = value; }
        }
        public List<Int32> DesasocciateImages
        {
            get
            {
                return m_DesasocciateImages;
            }
            set
            {
                m_DesasocciateImages = value;
            }
        }
        #endregion Propiedades

        #region Constructores
        #region summary
        /// <summary>
        /// Date: 04/28/2008
        /// Time: 13:13:16
        /// Generated by: VMCoder
        /// Generated using VirtualGenerator
        /// </summary>
        #endregion summary
        public EVendor_Visit_XMissionStructures_Pole()
            : base()
        {
            m_DesasocciateImages = new List<Int32>();

        }

        #region summary
        /// <summary>
        /// Date: 04/28/2008
        /// Time: 13:13:16
        /// Generated by: VMCoder
        /// Generated using VirtualGenerator
        /// </summary>
        #endregion summary
        public EVendor_Visit_XMissionStructures_Pole(Int32 vendor_Visit_XMissionStructures_PoleId)
            : this()
        {
            Id = vendor_Visit_XMissionStructures_PoleId;

        }

        #region summary
        /// <summary>
        /// Date: 04/28/2008
        /// Time: 13:13:16
        /// Generated by: VMCoder
        /// Generated using VirtualGenerator
        /// </summary>
        #endregion summary
        public EVendor_Visit_XMissionStructures_Pole(Int32 vendor_Visit_XMissionStructures_PoleId, EVendor_Visit_XMissionStructure vendor_Visit_XMissionStructure, EXMissionStructures_PoleTopType xMissionStructures_PoleTopType, EXMissionStructures_PoleSpecies xMissionStructures_PoleSpecies, EXMissionStructures_PoleTreatment xMissionStructures_PoleTreatment, Int32 year, EXMissionStructures_PoleClass xMissionStructures_PoleClass, double latitude, double longitude, double altitude, Int32 satelliteCount, DateTime satelliteTime, bool solutionAvailable, string aID, Int32 lVisit, string number, double length, string lVisitor)
            : this(vendor_Visit_XMissionStructures_PoleId)
        {
            Asset = vendor_Visit_XMissionStructure;
            TopType = xMissionStructures_PoleTopType;
            Species = xMissionStructures_PoleSpecies;
            Treatment = xMissionStructures_PoleTreatment;
            Year = year;
            Class = xMissionStructures_PoleClass;
            Latitude = latitude;
            Longitude = longitude;
            Altitude = altitude;
            SatelliteCount = satelliteCount;
            SatelliteTime = satelliteTime;
            SolutionAvailable = solutionAvailable;
            AID = aID;
            LVisit = lVisit;
            Number = number;
            Length = length;
            LVisitor = lVisitor;

        }
        #endregion Constructores

        #region Public Methods
        public void Desasocciate(Int32 imageID)
        {
            m_DesasocciateImages.Add(imageID);
        }

        #endregion

        #region Override
        public override string GetHtmlDescription()
        {
            StringBuilder _Shtml = new StringBuilder();
            _Shtml.AppendLine("<table style='backgroundcolor:#ffffff' border='0'>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td><b>Pole " + Id + "</b></td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Top Type: " + TopType.Name + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>KV: " + ((EVendor_Visit_XMissionStructure)Asset).Vendor_Visit_Type.Name.Replace("KV", "") + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Species: " + Species.Name + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Year: " + Year + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Treatment: " + Treatment.Name + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Length: " + Length + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Class: " + Class.Name + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Lat: " + Latitude.ToString("F6") + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Long: " + Longitude.ToString("F6") + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Alt: " + Altitude.ToString() + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Last Visitor: " + LVisitor + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Last Visit: " + LVisit + "</td>");
            _Shtml.AppendLine(" </tr>");
            _Shtml.AppendLine(" <tr>");
            _Shtml.AppendLine("     <td>Number: " + Number + "</td>");
            _Shtml.AppendLine(" </tr>");

            foreach (EBaseImage i in Images)
            {
                _Shtml.AppendLine(" <tr>");
                _Shtml.AppendLine(i.GetHtml());
                _Shtml.AppendLine(" </tr>");
            }
            _Shtml.AppendLine("</table>");
            return _Shtml.ToString();
        }

        protected override string GetPlacemarkId()
        {
            return "VendorPole_" + Id.ToString();
        }

        #endregion


    }
}

